package xmlcollabclient.core;

import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.Socket;
import javax.swing.JFrame;
import javax.swing.JOptionPane;

/**
 *
 * @author Sasa
 */
public class Communicator {

    String serverAddress = "localhost";
    Integer serverPort = 9876;
    Socket socket;
    DataOutputStream out;
    BufferedReader in;

    public Communicator() {
        try {
            socket = new Socket(serverAddress, serverPort);
            out = new DataOutputStream(socket.getOutputStream());
            in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
        } catch (Exception e) {
            JOptionPane.showMessageDialog(new JFrame(), "Error in comunications.");
            System.exit(0);
        }
    }
}
